package com.jplus.controller;

import com.jplus.VO.ResultVO;
import com.jplus.entity.User;
import com.jplus.handler.GlobalExceptionHandler;
import com.jplus.service.RegisterService;
import com.jplus.utils.ResultVOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@RestController
public class RegisterController extends GlobalExceptionHandler {

   @Autowired
   private RegisterService registerService;

    @RequestMapping(value = "/register", method = RequestMethod.POST)
    public ResultVO register(HttpServletRequest request, User user) {
        return registerService.register(request, user);
    }

    @RequestMapping(value = "/check/register", method = RequestMethod.POST)
    public ResultVO checkRegister(User user) {
        return registerService.checkRegister(user);
    }

}
